{% extends "base.html" %}

{% block title %}创建图书分类 - 墨韵图书共享平台{% endblock %}

{% block content %}
<div class="container py-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card ink-card">
                <div class="card-header ink-header">
                    <h4 class="mb-0"><i class="fas fa-tag me-2"></i>创建新分类</h4>
                </div>
                <div class="card-body">
                    <form action="{{ url_for('create_category') }}" method="POST">
                        <div class="mb-4">
                            <label for="name" class="form-label">分类名称</label>
                            <input type="text" class="form-control ink-input" id="name" name="name" required
                                   placeholder="请输入分类名称">
                        </div>
                        
                        <div class="mb-4">
                            <label for="description" class="form-label">分类描述</label>
                            <textarea class="form-control ink-input" id="description" name="description" rows="4"
                                      placeholder="请输入分类描述（可选）"></textarea>
                        </div>
                        
                        <div class="d-flex justify-content-between">
                            <a href="{{ url_for('list_categories') }}" class="btn btn-outline-secondary">
                                <i class="fas fa-arrow-left me-2"></i>返回分类列表
                            </a>
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-save me-2"></i>保存分类
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
.ink-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ink-header {
    background-color: #f8f9fa;
    border-bottom: none;
    padding: 1.5rem;
}

.ink-input {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.ink-input:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

textarea.ink-input {
    resize: vertical;
    min-height: 100px;
}
</style>
{% endblock %} 